<template>
  <ul class="todo-list">
  
    <li :class="{completed:item.isDone}" v-for="item in list" :key="item.id">
      <div class="view">
        <input class="toggle" v-model="item.isDone" type="checkbox" />
        <label>{{ item.name }}</label>
       
        <button class="destroy" @click="$emit('del',item.id)"></button>
      </div>
    </li>
  </ul>
</template>

<script>
export default {
  props:{
    list:{
      required:true,
      type: Array
    }
  }
  
}
</script>